package com.SouthernWall_404.AgeSuitcase.Common.API.Info;

import net.minecraft.nbt.CompoundTag;

public class AccountInfo {

    public static String NAME_TAG="name";
    public static String CODE_TAG ="code";
    public String name="";
    public String code="";
    public AccountInfo(String name,String code) {
        this.name=name;
        this.code=code;
    }

    public AccountInfo(CompoundTag accountPack)
    {

        if(accountPack.contains(NAME_TAG))
        {
            this.name=accountPack.getString(NAME_TAG);
        }
        if(accountPack.contains(CODE_TAG))
        {
            this.code=accountPack.getString(CODE_TAG);
        }
    }

    public CompoundTag getAccountPack()
    {
        CompoundTag accountPack=new CompoundTag();

        accountPack.putString(NAME_TAG,this.name);
        accountPack.putString(CODE_TAG,this.code);

        return accountPack;
    }
}
